package com.example.demo.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.Commdity;
import com.example.demo.entity.Order;
import com.example.demo.entity.Order2;
import com.example.demo.entity.User;
import com.example.demo.mapper.CommdityMapper;
import com.example.demo.mapper.UserMapper;
import com.example.demo.service.CommdityService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CommdityServiceImpl extends ServiceImpl<CommdityMapper, Commdity> implements CommdityService {
    @Resource
    public CommdityMapper commdityMapper;
    public List<Commdity> getList() {
        return commdityMapper.findAll();
    }

    public List<Commdity> getcommditylist(int shopid){return commdityMapper.findcommdity(shopid);}

    public List<Commdity> findby_id(int id)
    {
        return commdityMapper.findby_id(id);
    }
    public List<Commdity> getrelaidList(int relaid) {
        return commdityMapper.findBy_id(relaid);
    }

    public boolean addshoppingcart(String username,String objectname,double objectprice,String image)
    {
        commdityMapper.addshoppingcart(username, objectname, objectprice,image);
        return true;
    }


}

